/*
 *	Perlin Production Co. Ltd. September 2012 (c).
 *			bmplib.c
 *		Advanced Palette Generator
 */

#include "WinGDI.h"
#include "ParamLib.h"

PutBC(_bc, _verbose)
BC	*_bc;
int	_verbose;
{
	if (_verbose == VERBMAX)
	{
		printf("BITMAPCOREHEADER\n");
		printf("bcSize=%u\n"		, _bc->bcSize);
		printf("bcWidth=%u\n"		, _bc->bcWidth);
		printf("bcHeight=%u\n"		, _bc->bcHeight);
		printf("bcPlanes=%u\n"		, _bc->bcPlanes); 
		printf("bcBitCount=%u\n"	, _bc->bcBitCount); /* 1 4 8 24 */
	}
	Chk64K(&(_bc->bcSize), "header size");
	
	ChkMax(_bc->bcWidth, 0x100, "width");
	ChkMax(_bc->bcHeight, 0x100, "height");
	if (_bc->bcHeight < 0)  NotSupported("top down pixel order");
	if (_bc->bcBitCount != 4) NotSupported("bit count");
}



PutBI(_bi, _verbose)
BI	*_bi;
int	_verbose;
{
	if (_verbose == VERBMAX)
	{
		printf("BITMAPINFOHEADER\n");
		printf("biSize=%u\n"		, _bi->biSize);
		printf("biWidth=%d\n"		, _bi->biWidth);
		printf("biHeight=%d\n"		, _bi->biHeight);
		printf("biPlanes=%u\n"		, _bi->biPlanes); 
		printf("biBitCount=%u\n"	, _bi->biBitCount); /* 1 4 8 16 24 32*/
		printf("biCompression=%u\n"	, _bi->biCompression);
	}
	
	ChkMax(_bi->biWidth, 0x100, "width");
	ChkMax(_bi->biHeight, 0x100, "height");
	if (_bi->biHeight < 0)  NotSupported("top down pixel order");
	if (_bi->biBitCount != 4) NotSupported("bit count");
	if (_bi->biCompression) NotSupported("file compression");
}
